package com.zbkj.admin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单表 实体类。
 *
 * @author mybatis-flex-helper automatic generation
 * @since 1.0
 */
@Accessors(chain = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "订单表")
@TableName(value = "eb_order")
@Table(value = "eb_order")
public class EbOrderEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 订单ID
     */
    @Schema(description = "订单ID")
    @Id(keyType = KeyType.Auto)
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 订单号
     */
    @Schema(description = "订单号")
    @Column(value = "order_no")
    @TableField(value = "order_no")
    private String orderNo;

    /**
     * 商户ID,商户订单等级有值
     */
    @Schema(description = "商户ID,商户订单等级有值")
    @Column(value = "mer_id")
    @TableField(value = "mer_id")
    private Integer merId;

    /**
     * 用户id
     */
    @Schema(description = "用户id")
    @Column(value = "uid")
    @TableField(value = "uid")
    private Integer uid;

    /**
     * 用户父级Id
     */
    @Schema(description = "用户父级Id")
    @Column(value = "p_uid")
    @TableField(value = "p_uid")
    private Integer pUid;

    /**
     * 订单商品总数
     */
    @Schema(description = "订单商品总数")
    @Column(value = "total_num")
    @TableField(value = "total_num")
    private Integer totalNum;

    /**
     * 商品总价
     */
    @Schema(description = "商品总价")
    @Column(value = "pro_total_price")
    @TableField(value = "pro_total_price")
    private BigDecimal proTotalPrice;

    /**
     * 邮费
     */
    @Schema(description = "邮费")
    @Column(value = "total_postage")
    @TableField(value = "total_postage")
    private BigDecimal totalPostage;

    /**
     * 订单总价
     */
    @Schema(description = "订单总价")
    @Column(value = "total_price")
    @TableField(value = "total_price")
    private BigDecimal totalPrice;

    /**
     * 优惠券金额
     */
    @Schema(description = "优惠券金额")
    @Column(value = "coupon_price")
    @TableField(value = "coupon_price")
    private BigDecimal couponPrice;

    /**
     * 使用积分
     */
    @Schema(description = "使用积分")
    @Column(value = "use_integral")
    @TableField(value = "use_integral")
    private Integer useIntegral;

    /**
     * 积分抵扣金额
     */
    @Schema(description = "积分抵扣金额")
    @Column(value = "integral_price")
    @TableField(value = "integral_price")
    private BigDecimal integralPrice;

    /**
     * 实际支付金额
     */
    @Schema(description = "实际支付金额")
    @Column(value = "pay_price")
    @TableField(value = "pay_price")
    private BigDecimal payPrice;

    /**
     * 支付邮费
     */
    @Schema(description = "支付邮费")
    @Column(value = "pay_postage")
    @TableField(value = "pay_postage")
    private BigDecimal payPostage;

    /**
     * 支付状态
     */
    @Schema(description = "支付状态")
    @Column(value = "paid")
    @TableField(value = "paid")
    private Integer paid;

    /**
     * 支付时间
     */
    @Schema(description = "支付时间")
    @Column(value = "pay_time")
    @TableField(value = "pay_time")
    private LocalDateTime payTime;

    /**
     * 支付方式:weixin,alipay,yue
     */
    @Schema(description = "支付方式:weixin,alipay,yue")
    @Column(value = "pay_type")
    @TableField(value = "pay_type")
    private String payType;

    /**
     * 支付渠道：public-公众号,mini-小程序，h5-网页支付,yue-余额，wechatIos-微信Ios，wechatAndroid-微信Android,alipay-支付宝，alipayApp-支付宝App
     */
    @Schema(description = "支付渠道：public-公众号,mini-小程序，h5-网页支付,yue-余额，wechatIos-微信Ios，wechatAndroid-微信Android,alipay-支付宝，alipayApp-支付宝App")
    @Column(value = "pay_channel")
    @TableField(value = "pay_channel")
    private String payChannel;

    /**
     * 订单状态（0：待支付，1：待发货,2：部分发货， 3：待核销，4：待收货,5：已收货,6：已完成，9：已取消）
     */
    @Schema(description = "订单状态（0：待支付，1：待发货,2：部分发货， 3：待核销，4：待收货,5：已收货,6：已完成，9：已取消）")
    @Column(value = "status")
    @TableField(value = "status")
    private Integer status;

    /**
     * 退款状态：0 未退款 1 申请中 2 部分退款 3 已退款
     */
    @Schema(description = "退款状态：0 未退款 1 申请中 2 部分退款 3 已退款")
    @Column(value = "refund_status")
    @TableField(value = "refund_status")
    private Integer refundStatus;

    /**
     * 取消状态：0-未取消，1-系统取消，2-用户取消
     */
    @Schema(description = "取消状态：0-未取消，1-系统取消，2-用户取消")
    @Column(value = "cancel_status")
    @TableField(value = "cancel_status")
    private Integer cancelStatus;

    /**
     * 用户是否删除
     */
    @Schema(description = "用户是否删除")
    @Column(value = "is_user_del")
    @TableField(value = "is_user_del")
    private Integer isUserDel;

    /**
     * 商户是否删除
     */
    @Schema(description = "商户是否删除")
    @Column(value = "is_merchant_del")
    @TableField(value = "is_merchant_del")
    private Integer isMerchantDel;

    /**
     * 赠送积分
     */
    @Schema(description = "赠送积分")
    @Column(value = "gain_integral")
    @TableField(value = "gain_integral")
    private Integer gainIntegral;

    /**
     * 商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号
     */
    @Schema(description = "商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号")
    @Column(value = "out_trade_no")
    @TableField(value = "out_trade_no")
    private String outTradeNo;

    /**
     * 支付重定向地址
     */
    @Schema(description = "支付重定向地址")
    @Column(value = "redirect")
    @TableField(value = "redirect")
    private String redirect;

    /**
     * 订单类型:0-基础订单,1-秒杀订单,2-拼团订单
     */
    @Schema(description = "订单类型:0-基础订单,1-秒杀订单,2-拼团订单")
    @Column(value = "type")
    @TableField(value = "type")
    private Integer type;

    /**
     * 订单等级:0-平台订单，1-商户订单
     */
    @Schema(description = "订单等级:0-平台订单，1-商户订单")
    @Column(value = "level")
    @TableField(value = "level")
    private Integer level;

    /**
     * 平台订单号
     */
    @Schema(description = "平台订单号")
    @Column(value = "plat_order_no")
    @TableField(value = "plat_order_no")
    private String platOrderNo;

    /**
     * 是否删除
     */
    @Schema(description = "是否删除")
    @Column(value = "is_del")
    @TableField(value = "is_del")
    private Integer isDel;

    /**
     * 收货时间
     */
    @Schema(description = "收货时间")
    @Column(value = "receiving_time")
    @TableField(value = "receiving_time")
    private LocalDateTime receivingTime;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @Column(value = "create_time")
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    @Column(value = "update_time")
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 商户优惠券金额
     */
    @Schema(description = "商户优惠券金额")
    @Column(value = "mer_coupon_price")
    @TableField(value = "mer_coupon_price")
    private BigDecimal merCouponPrice;

    /**
     * 平台优惠券金额
     */
    @Schema(description = "平台优惠券金额")
    @Column(value = "plat_coupon_price")
    @TableField(value = "plat_coupon_price")
    private BigDecimal platCouponPrice;

    /**
     * 平台优惠券id
     */
    @Schema(description = "平台优惠券id")
    @Column(value = "plat_coupon_id")
    @TableField(value = "plat_coupon_id")
    private Integer platCouponId;

    /**
     * svip优惠金额
     */
    @Schema(description = "svip优惠金额")
    @Column(value = "svip_discount_price")
    @TableField(value = "svip_discount_price")
    private BigDecimal svipDiscountPrice;

    /**
     * 是否svip订单
     */
    @Schema(description = "是否svip订单")
    @Column(value = "is_svip")
    @TableField(value = "is_svip")
    private Integer isSvip;

    /**
     * 订单二级类型:0-普通订单，1-积分订单，2-虚拟订单，4-视频号订单，5-云盘订单，6-卡密订单
     */
    @Schema(description = "订单二级类型:0-普通订单，1-积分订单，2-虚拟订单，4-视频号订单，5-云盘订单，6-卡密订单")
    @Column(value = "second_type")
    @TableField(value = "second_type")
    private Integer secondType;

    /**
     * 兑换积分
     */
    @Schema(description = "兑换积分")
    @Column(value = "redeem_integral")
    @TableField(value = "redeem_integral")
    private Integer redeemIntegral;

    /**
     * 系统表单ID
     */
    @Schema(description = "系统表单ID")
    @Column(value = "system_form_id")
    @TableField(value = "system_form_id")
    private Integer systemFormId;

    /**
     * 系统表单数据
     */
    @Schema(description = "系统表单数据")
    @Column(value = "order_extend")
    @TableField(value = "order_extend")
    private String orderExtend;

    /**
     * 拼团订单状态：0=进行中，10=已成功，-1=已失败, 99=非拼团订单
     */
    @Schema(description = "拼团订单状态：0=进行中，10=已成功，-1=已失败, 99=非拼团订单")
    @Column(value = "group_buy_record_status")
    @TableField(value = "group_buy_record_status")
    private Integer groupBuyRecordStatus;

    /**
     * 抵用券使用金额
     */
    @Schema(description = "抵用券使用金额")
    @Column(value = "voucher")
    @TableField(value = "voucher")
    private BigDecimal voucher;


}
